package com.ytlz.dmcs.model.system.entity;

import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

@Document(collection="sys_field")
public class SysField {
	@Id
	private String id;
	
	private String name;
	
	private String label;
	
	@Field("data_type")
	private String datatype;
	
	private String scope;
	
	
	
	@DBRef
	private SysObject parentObj;

	@PersistenceConstructor
	public SysField(String name,String label,String datatype,String scope,SysObject parentObj) {
		this.name = name;
		this.label = label;
		this.datatype = datatype;
		this.scope=scope;
		this.parentObj = parentObj;
	}
	
	@PersistenceConstructor
	public SysField(String name,String label,String datatype,String scope) {
		this.name = name;
		this.label = label;
		this.scope=scope;
		this.datatype = datatype;
	}	
	
	public String getScope() {
		return scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getDatatype() {
		return datatype;
	}

	public void setDatatype(String datatype) {
		this.datatype = datatype;
	}

	public SysObject getParentObj() {
		return parentObj;
	}

	public void setParentObj(SysObject parentObj) {
		this.parentObj = parentObj;
	}
	
	
}
